<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>添加/修改页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../component/elementUI/index.css">
    <link rel="stylesheet" href="../../../component/pear/css/pear.css" />
    <link rel="stylesheet" href="../../../style/wangeditor.css">
    <link rel="stylesheet" href="../../../style/index.css">
</head>

<body>
    <div id="app" v-cloak>
        <div class="add">
            <div class="header">
                <span>{{(action == 'Add'?'添加':'修改')}}农作物品种管理</span>
            </div>
            <div class="main" style="padding: 0 15px;">
                <!-- 配置属性, 目前仅支持 单主表 多子表 结构 -->
                <div id="form" :data-options="JSON.stringify({'tableName':'crop','formName':'dataForm' ,'primaryKey':'Crop_SerialNumber'})"></div>
                <div class="table_titel">
                    <div class="titel">品种列表</div>
                </div>
                <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
                    <el-descriptions :column="1" size="large" border>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item">图片</div>
                            </template>
                            <el-form-item prop="Picture_URL">
                                <yl-upload v-model="dataForm.Picture_URL"></yl-upload>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">品种名称</div>
                            </template>
                            <el-form-item prop="Crop_Name"
                                :rules="[{ required: true, message: '请输入品种名称', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Crop_Name" placeholder="请输入品种名称"></el-input>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item">学名</div>
                            </template>
                            <el-form-item prop="Scientific_Name">
                                <el-input v-model.trim="dataForm.Scientific_Name" placeholder="可输入学名"></el-input>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">所属分类</div>
                            </template>
                            <el-form-item prop="Parent_SerialNumber"
                                :rules="[{ required: true, message: '请选择所属分类', trigger: 'change' }]">
                                <el-cascader v-model.trim="dataForm.Parent_SerialNumber" filterable
                                    :props="{label:'Crop_Type_Name',value:'Crop_Type_SerialNumber',emitPath:false}"
                                    :options="crop_type" clearable placeholder="请选择所属分类"
                                    style="width: 100%;"></el-cascader>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">生长期</div>
                            </template>
                            <el-form-item prop="Growth_Period"
                                :rules="[{ required: true, message: '请输入生长期', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Growth_Period" placeholder="请输入生长期"></el-input>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">适宜温度</div>
                            </template>
                            <el-form-item prop="Optimal_Temperature"
                                :rules="[{ required: true, message: '请输入适宜温度', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Optimal_Temperature" placeholder="请输入适宜温度"></el-input>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item">品种特征</div>
                            </template>
                            <el-form-item prop="Variety_Characteristics">
                                <el-input type="textarea" :autosize="{ minRows: 4}"
                                    v-model.trim="dataForm.Variety_Characteristics" placeholder="可输入品种特征"></el-input>
                            </el-form-item>
                        </el-descriptions-item>
                    </el-descriptions>
                </el-form>
            </div>
            <div class="footer">
                <el-button size="medium" @click="handleBack">返回</el-button>
                <el-button size="medium" type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="../../../utils/wangeditor.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../utils/vue.min.js"></script>
    <script type="text/javascript" src="../../../utils/vuex.min.js"></script>
    <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
    <script type="text/javascript" src="../../../utils/components.js"></script>
    <script type="text/javascript" src="../../../utils/compressor.js"></script>
    <script type="text/javascript" src="../../../utils/validity.js"></script>
    <script type="text/javascript" src="../../../utils/utils.js"></script>
    <script type="text/javascript" src="../../../utils/http.js"></script>
    <script type="text/javascript" src="js/add.js"></script>
</body>

</html>